'''
Author: Simon
Date: 2022-01-31 10:15:38
LastEditTime: 2022-02-04 23:42:28
LastEditors: Please set LastEditors
Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEss
FilePath: /SimonBackend/SimondeAPI/models.py
'''
from django.db import models
from django.utils import timezone

# Create your models here.
class MomentInfo(models.Model):
    id = models.AutoField(primary_key=True)
    create_at = models.DateTimeField('Artical Create Time', default=timezone.now)
    comments = models.CharField("Comments", max_length=200, default="")
    imgURL = models.CharField("Image URL", max_length=10000, default="")

    class Meta:
        verbose_name = "MomentInfo"
        verbose_name_plural = verbose_name
    def __str__(self):
        return str(self.id)

class ArticalInfo(models.Model):
    id = models.AutoField(primary_key=True)
    news_id = models.CharField("WeiBo Hot News ID", max_length=100, default="")
    title = models.CharField('Artical Title', max_length=1000, default="")
    create_at = models.DateTimeField('Artical Create Time', default=timezone.now)
    content = models.CharField("Contents", max_length=10000, default="")
    imgURL = models.CharField("Image URL1", max_length=1000, default="")
    tag1 = models.CharField("Tag 1", max_length=10, default="")
    tag2 = models.CharField("Tag 1", max_length=10, default="")
    
    class Meta:
        verbose_name = "ArticalInfo"
        verbose_name_plural = verbose_name
    def __str__(self):
        return self.title
    